package models;

import play.*;
import play.data.validation.Required;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
public class Restaurant extends Model {
    @Required
    public String name;
    
    @Required
    public int plz;
    public String description;
    public String address;
    public String telephone;
    
    @OneToMany(mappedBy = "restaurant", cascade = CascadeType.ALL)
    public List<Dish> dishes = new LinkedList<Dish>();

	public Restaurant(String name, int plz, List<Dish> dishes,
			String description, String address, String telephone) {
		super();
		this.name = name;
		this.plz = plz;
		this.dishes = dishes;
		this.description = description;
		this.address = address;
		this.telephone = telephone;
	}

	@Override
	public String toString() {
		return "Restaurant [name=" + name + ", plz=" + plz + ", description="
				+ description + ", address=" + address + ", telephone="
				+ telephone + ", dishes=" + dishes + "]";
	}

	
    
}
